﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ylh.Model;
using Ylh.IDAL;
using Ylh.DBUtility;
using System.Data;
using System.Configuration;

namespace Ylh.SQLServerDAL
{
    public class TbSmDbDAL : ISmDb
    {
        string Constr = ConfigurationManager.ConnectionStrings["ConStr"].ToString();

        /// <summary>
        /// 方法只用于第一次获取数据库链接字符串用
        /// </summary>
        /// <returns></returns>
        public string GetConnectionStr()
        {
            string sql = @"select DbConnection from tbsmdb";

            DataTable dt = SqlHelper.ExcuteQuery(Constr, sql, System.Data.CommandType.Text);

            return dt.Rows[0]["DbConnection"].ToString();
        }
    }
}
